package cn.script.common;

import cn.script.domain.Point;
import cn.script.domain.RangePoint;

/**
 * 坐标常量
 *
 * @author 周永波
 */
public class CoordConst {
    /**
     * 回城按钮显示的范围
     */
    public static final RangePoint BACK = new RangePoint(429, 267, 527, 578);

    /**
     * 对话范围
     */
    public static final RangePoint DIALOGUE = new RangePoint(28, 70, 289, 398);

    /**
     * 游戏窗口
     */
    public static final RangePoint WIN = new RangePoint(0, 0, 800, 600);

    /**
     * npc偏移
     *
     * @param npcName
     * @return
     */
    public static Point offset_npc(String npcName) {
        return Point.point((npcName.length() / 2 - 1) * 10, 80);
    }

    /**
     * npc偏移
     *
     * @return
     */
    public static Point offset_text() {
        return Point.point(11, 5);
    }

    /**
     * 人名 点击
     *
     * @param name
     * @return
     */
    public static Point offset_name(String name, int rx) {
        return Point.point((1 - rx) * 11, 80);
    }
}
